package adapters

import (
	"ai-gateway/proto"
	"context"
)

// 原有同步适配器接口
type AIAdapter interface {
	Call(ctx context.Context, req *proto.AIRequest) (*proto.AIResponse, error)
}

// 新增流式适配器接口
type StreamAIAdapter interface {
	StreamCall(ctx context.Context, req *proto.AIRequest, stream proto.AdapterService_StreamCallAIServer) error
}

// 注册中心扩展
var (
	AdapterRegistry       = map[string]AIAdapter{}
	StreamAdapterRegistry = map[string]StreamAIAdapter{} // 流式适配器注册表
)

// 同步适配器注册函数
func RegisterAdapter(provider string, adapter AIAdapter) {
	AdapterRegistry[provider] = adapter
}

// 流式适配器注册函数
func RegisterStreamAdapter(provider string, adapter StreamAIAdapter) {
	StreamAdapterRegistry[provider] = adapter
}
